//
//  UIView+Toast.m
//
//  Created by haoyi on 14-5-8.
//  Copyright (c) 2014年 Calvin. All rights reserved.
//

#import <UIKit/UIKit.h>



static const CGFloat CSToastActivityDefaultDuration = 3.0;


@interface UIView (Toast)

// each makeToast method creates a view and displays it as toast
- (void)makeToast:(NSString *)message;
- (void)makeToast:(NSString *)message position:(id)position;
- (void)makeToast:(NSString *)message duration:(NSTimeInterval)interval;
- (void)makeToast:(NSString *)message duration:(NSTimeInterval)interval position:(id)position;
- (void)makeToast:(NSString *)message duration:(NSTimeInterval)interval position:(id)position image:(UIImage *)image;
- (void)makeToast:(NSString *)message duration:(NSTimeInterval)interval position:(id)position title:(NSString *)title;
- (void)makeToast:(NSString *)message duration:(NSTimeInterval)interval position:(id)position title:(NSString *)title image:(UIImage *)image;

// displays toast with an activity spinner
- (void)makeToastActivity;
- (void)makeToastActivity:(id)position;
- (void)makeToastActivitywithMessage:(NSString *)message;
- (void)makeToastActivity:(id)position withMessage:(NSString *)message;
- (void)hideToastActivity;
- (void)hideToastActivityWithSuccess:(NSString *)successString;
- (void)hideToastActivityWithError:(NSString *)errorString;

// the showToast methods display any view as toast
- (void)showToast:(UIView *)toast;
- (void)showToast:(UIView *)toast duration:(NSTimeInterval)interval position:(id)point;

- (void)showToast:(UIView *)toast whileExeBlock:(dispatch_block_t)block;

@end
